{% import "macro.html.twig" as web_macro %}
{% if reviews %}
	<div class="es-box">
		<div class="es-box-heading">
			<h2>{{ 'homepage.student_evaluate'|trans }}</h2>
		</div>
	<ul class="media-list latest-review-list">
		{% for review in reviews %}
		  {% set author = users[review.userId]|default(null) %}
		  {% set course = courses[review.targetId]|default(null) %}
      {% set courseSet = courseSets[course.courseSetId]|default(null) %}
		  {% if author and course %}
			  <li class="media">

			  	{{ web_macro.user_avatar(author,'author-picture-link','author-picture') }}
			  	{{ web_macro.user_link(author, 'author-nickname')}}

			  	<span class="color-gray">{{'homepage.reviewer_comment_course'|trans}}</span> <br>
			  	<div class="review-content">{{ review.content|plain_text(50) }}</div>

				  <div class="review-footer">
					  <a href="{{ path('course_show', {id: courseSet.defaultCourseId}) }}" class="course-title"> 《 {{ courseSet.title }} 》</a>
					  <span class="divider"></span>
					  <span class="stars-{{ review.rating }}">&nbsp;</span>
				  </div>
			  </li>
		  {% endif %}
		{% endfor %}
	</ul>
	</div>
{% endif %}
